﻿using System.Collections.ObjectModel; 
using TeaLightV5.Foundation.UX.Models;
using System.Windows.Input;
using Cirrious.MvvmCross.Commands;
using Conference.Core.BL.Entities;
using Conference.Core.UX.Models;

namespace Conference.Core.UX.ViewModels
{
 	public partial class SessionListEntityViewModel : ListEntityViewModel<SessionModel, SessionEntity, SessionReadEntityViewModel> 
    { 
		   
        public override ICommand ItemSelectedCommand
        {
            get
            {
                return new MvxRelayCommand<SessionReadEntityViewModel>(
                    (e) => RequestNavigate<SessionReadEntityViewModel>(
                        new SessionModelParameters() { Id = e.Data.Id }
                        )
                    );
            }
        }

        public override ICommand AddCommand
        {
            get
            {
                return new MvxRelayCommand(OnAdd);
            }
        }

        private void OnAdd()
        {
            RequestNavigate<SessionUpdateEntityViewModel>(new SessionModelParameters());
        }

    }  
}
